package com.youlu.campus.entity.course;

import com.youlu.campus.base.base.EntityBase;
import lombok.Data;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.time.LocalDateTime;

/**
 * @author : [dengbo]
 * @className : UserActivityCourse
 * @description : [用户课程信息]
 * @createTime : [2022/5/17 22:48]
 */
@Data
@Document(collection = "user_activity_course")
@CompoundIndexes({
        @CompoundIndex(name = "idx_user_app_activity", def = "{'userId':-1,'appId':1,'activityId':-1}")
})
public class UserActivityCourse extends EntityBase {
    /**
     * 活动ID
     */
    private String activityId;
    /**
     * 课程ID
     */
    private String courseId;
    /**
     * 应用app
     */
    private String appId;
    /**
     * 用户ID
     */
    private String userId;
    /**
     * 活动状态 0:解锁课程、1:观看学习、2:考试答题、3:领取证书
     */
    @Indexed
    private Integer status = 0;
    /**
     * 是否报名
     */
    private Boolean joined = Boolean.FALSE;
    /**
     * 学习完成时间
     */
    private LocalDateTime studyCompleteTime;
    /**
     * 题库ID
     */
    private String qaInfoId;
}
